<template>
  <div class="login" :style="'background-image:url(' + Background + ');'">
    <div class="el-divider--vertical">
      <h1 class="title">欢迎使用云易学教育平台</h1>
      <el-tabs
        v-model="activeName"
        :stretch="true"
        type="border-card"
        @tab-click="handleClick"
        v-if="!isfindpwd"
        class="login-card"
      >
        <el-tab-pane label="学生登录" name="student">
          <in urlType="student" title="学号" @isfindPwd="setFindPwd"></in>
        </el-tab-pane>
        <el-tab-pane label="老师登录" name="teacher">
          <in urlType="teacher" title="工号" @isfindPwd="setFindPwd"></in>
        </el-tab-pane>
        <!-- <el-tab-pane label="注册" name="third">
            <registered></registered>
        </el-tab-pane>-->
      </el-tabs>
      <div v-if="isfindpwd">
        <findpwd :userType="activeName"></findpwd>
      </div>
    </div>
  </div>
</template>
<script>
import In from './login/in';
import Registered from './login/registered';
import Background from '@/assets/images/bg.jpeg';
import findpwd from './login/findpwd.vue';
export default {
  name: 'Login',
  components: { Registered, findpwd, In },
  data() {
    return {
      isfindpwd: false,
      activeName: 'student',
      Background: Background,
    };
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    },
    setFindPwd(judge) {
      this.isfindpwd = judge;
    },
  },
  create() {
    console.log('login++++++++++++++++');
  },
};
</script>

<style rel="stylesheet/scss">
/* @import "../assets/style/layout/layout.css"; */
.login {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
}
.el-divider--vertical {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* position: absolute;
  height: 600px;
  top: 45%;
  border-radius: 10px;
  transform: translate(-50%, -50%); */
}
.title {
  margin: 20px 0 30px 0;
  text-align: center;
  color: #707070;
}

.login-card {
  width: 500px;
  height: 500px;
  opacity: 0.1;
  border-radius: 20px;
  overflow: hidden;
}
</style>
